Skip to content

fix: local references#20

Merged
ntoulasm merged 2 commits into
mainfrom
fix/local-references
Mar 16, 2026
Merged

fix: local references#20
ntoulasm merged 2 commits into
mainfrom
fix/local-references

Conversation

@ntoulasm

@ntoulasm ntoulasm commented Mar 16, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #19
This PR fixes resolution of local references (e.g., "$ref": "#/a") . Previously, the logic assumed fragments as relative file system paths, leading to incorrect absolute path calculations resolving always to the parent folder of the source document.

Key Changes

  1. Added a unit test to definition.test.ts to reproduce the error
  2. Added /testfiles/local-references.jref
  3. Updated resolveTargetUriAndFragment to ensure local references resolve to the current documentUri

- Added 'isLocalReference' to ensure local references are resolved to the current document
- Added a testfile with local references
- Fixed the unit test assertion to match the go to definition offset
@ntoulasm ntoulasm self-assigned this Mar 16, 2026
@ntoulasm ntoulasm merged commit d208e19 into main Mar 16, 2026
2 checks passed
@ntoulasm ntoulasm mentioned this pull request Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Jason's Review

1 participant